from django.db import models


class Area(models.Model):
    """行政區劃"""
    name = models.CharField(max_length=20,verbose_name="名稱")
    parent = models.ForeignKey('self',on_delete=models.SET_NULL,related_name="subs",null=True,blank=True,verbose_name="上級行政區劃")

    class Meta:
        db_table = 'tb_areas'


    def __str__(self):
        return self.name
